
public class work4 {
	public static void main(String[] args) {
		int size = 1;
		int j = 0;
		int oldArr[] = { 1, 3, 4, 5, 0, 0, 6, 6, 0, 5, 4, 7, 6, 7, 0, 5 };
		for (int i = 0; i < 15; i++) {
			if (oldArr[i] != 0) {
				size++;
			}
		}

		int newArr[] = new int[size];
		for (int i = 0; i < 16; i++) {
			if (oldArr[i] != 0) {
				newArr[j++] = oldArr[i];
				System.out.println("new[" + (j - 1) + "]=" + oldArr[i]);
			}
		}
	}
}
